<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<script language="javaScript" type="text/javascript"
	src="<c:url value='/cal/calendar.js'/>">
</script>

<link href="<c:url value='/cal/calendar.css'/>" rel="stylesheet"
	type="text/css">
<link href="<c:url value='/Styles/style.css'/>" rel="stylesheet"
	type="text/css" />

</head>
<body>
	<div class="page">
		<div id="header-wrapper">
			<div id="header">
				<div id="logo">
					<h4>ADMIN</h4>
				</div>
			</div>
		</div>

		<div class="page-wrapper">
			<div class="main">
				<div class="colleft">
					<div class="col1">
						<h4><%@ include file="admin-logout.jsp"%></h4>
						<h4><%@ include file="admin-menu.jsp"%></h4>
					</div>
					<div class="col2">
						<h1>
							<u
								style="FONT-FAMILY: 'Candara'; BACKGROUND-COLOR: #8080ff; COLOR: #000000;">Leave
								Application Processing System</u>
						</h1>
						<h2>Position Manager</h2>
						<c:if test="${state != 'initupdate'}">
						<form action="position" method="get">
							<table>
								<tr>
									<td><input name="action" value="add" type="hidden"></td>
								</tr>
								<tr>
									<td>ID</td>
									<td><input name="id" readonly="readonly">
									</td>
								</tr>
								<tr>
									<td>RANK</td>
									<td><input name="rank">
									</td>
								</tr>
								<tr>
									<td>ROLE</td>
									<td><input name="role">
									</td>
								</tr>
								<tr>
									<td>TOTAL ANNUAL ALLOWANCE</td>
									<td><input name="t1">
									</td>
								</tr>
								<tr>
									<td>TOTAL MEDICAL ALLOWANCE</td>
									<td><input name="c1">
									</td>
								</tr>
								<tr>
									<td colspan=2><input type="submit" value="Add Position">
									</td>
								</tr>
							</table>
						</form>
						</c:if>
						<c:if test="${state == 'initupdate'}">
						<form action="position" method="get">
							<table>
								<tr>
									<td><input name="action" value="update" type="hidden"></td>
								</tr>
								<tr>
									<td>ID</td>
									<td><input name="id" readonly="readonly" value='${id}'>
									</td>
								</tr>
								<tr>
									<td>RANK</td>
									<td><input name="rank" value='${rank}'>
									</td>
								</tr>
								<tr>
									<td>ROLE</td>
									<td><input name="role" value='${role}'>
									</td>
								</tr>
								<tr>
									<td>TOTAL ANNUAL ALLOWANCE</td>
									<td><input name="t1" value='${t1}'>
									</td>
								</tr>
								<tr>
									<td>TOTAL MEDICAL ALLOWANCE</td>
									<td><input name="c1" value='${c1}'>
									</td>
								</tr>
								<tr>
									<td colspan=2><input type="submit" value="Update Position">
									</td>
								</tr>
							</table>
						</form>
						</c:if>	
						<h4>
							<c:out value="${msg}" />
						</h4>

						<c:if test="${state != 'initupdate'}">
							<table id="add" border="1">
								<c:forEach var="pos" items="${posList}">
									<tr>
										<td><c:out value="${pos.id}" />
										</td>
										<td><c:out value="${pos.rank}" />
										</td>
										<td><c:out value="${pos.role}" />
										</td>
										<td><c:out value="${pos.totalAnnualAllowance}" />
										</td>
										<td><c:out value="${pos.totalMedicalAllowance}" />
										</td>																		
										<td>
										<a href="
										<c:url value='/admin/position'>
											<c:param name='action' value='initupdate' />
											<c:param name='id' value='${pos.id}' />
										</c:url>
										">update</a>
										</td>
										<td>
										<a href="
										<c:url value='/admin/position'>
											<c:param name='action' value='delete' />
											<c:param name='id' value='${pos.id}' />
										</c:url>
										">delete</a>
										</td>
									</tr>
								</c:forEach>
								<h4>
									<c:out value="${msg1}" />
								</h4>
							</table>
						</c:if>	
						
					</div>
					<!-- end col2 -->

				</div>
				<!-- end colleft -->

			</div>
			<!-- end main -->

		</div>
		<!-- end page-wrapper -->

	</div>
	<!-- end page -->

</body>
</html>